<?php
namespace app\index\controller;

use app\index\model\Index as Indexss;
use think\Controller;
use think\Request;
use think\Session;
use think\Cookie;
use think\Hook;

class index extends Controller
{

	public function _initialize()
    {
        // $this->view = new \think\View();
        // $this->article = new app\index\model();
    }
    public function index()
    {
      

        // show(model('Base')->query('SELECT * FROM aws_article cross join aws_question on 0=0'));

        // $this->assign('list',$list = $this->mergeArray());
        // show($lsit);
		return $this->fetch();
    }

    private function mergeArray($filed="id",$sort="DESC"){
       // $sql1="SELECT IFNULL(@region_name,0), user.uid,user.user_name,user.avatar_file,ar.add_time,ar.id,ar.id as article_id,ar.views as view,ar.comments as comment,ar.votes as vote,ar.title,ar.message FROM aws_article ar  inner join aws_users  user on ar.uid=user.uid";
       //  $sql2="SELECT IFNULL(@region_name,555), user.uid,user.user_name,user.avatar_file,qu.add_time,qu.question_id as id,qu.question_id,qu.view_count as view,qu.comment_count as comment,qu.agree_count as agree,qu.question_content,qu.question_detail FROM aws_question as qu  join aws_users  user on user.uid=qu.published_uid";
       //  show(model('Base')->query($sql1." UNION ALL ".$sql2)) ;

    }
}
